<?php

define('REP_ROOT', '');
require(REP_ROOT . 'config.php');

if(!isset($_SESSION['id_user']))
    redirectFront('connexion');

if(isset($_POST['submit'])) {
    $id_discussion = modelReportingDiscussion::newDiscussion($_POST['titre'], $_POST['message'], $_SESSION['id_user'], modelReportingDiscussion::ETAT_RETOUR);
    redirectFront('profil-message-lire', 'id='.$id_discussion);
}

$page = new rootLayoutPage();
$page->setBaliseTitle('profil_message_nouveau_balise');
$page->setDescription('profil_message_nouveau_description');
//$page->addJavaScript('jquery.my.pagination.js');
//$page->addStyleSheet('pagination.css');
//$page->addStyleSheet('jRating.css');
//$page->addStyleSheet('table_sorter.css');

//-- corps de la page -------//
$tpl_file='profil-message-nouveau.tpl';
$profil_message_nouveau = new flyLayout(REP_TPL . $tpl_file);
$profil_message_nouveau->start();

/*$tabs = new layoutTabs();
$tabs->pushLink('Mon compte', '/profil.php');
$tabs->pushLink('Mes messages', '/profil-message.php');
$profil_message_nouveau->includeLayout('tabs', $tabs);*/
$profil_message_nouveau->stop();
//--------------------------//

$page->setBody($profil_message_nouveau);
$page->display();

?>